
#ifndef _ROBOTBASE_H__
#define _ROBOTBASE_H__


#include "MotionAPI.hpp"

#include <vtkActor.h>
#include <vtkAssembly.h>
#include <TopoDS_Shape.hxx>


NAMESPACE_BEGIN(NSRobotBase)


struct TopoData {
	TopoDS_Shape shape;
	double origin[3];
	double xdir[3];
	double ydir[3];
	double zdir[3];

};


class MOTIONAPI RobotBase : public QObject {
	Q_OBJECT
public:
	RobotBase();
	~RobotBase();
public:
	inline void setRobotName(QString name) { m_name = name; };
	inline void setRobotPath(QString& path) { m_path = path; };
	inline QString& getRobotName() { return m_name; };
	inline QString& getRobotPath() { return m_path; };
	inline void addJoint(int id, SP(vtkAssembly, joint)) { m_joints.insert(id, joint); };
	inline SP(vtkAssembly,) getJoint(int id) { return m_joints.value(id); };
	inline QMap<int, SP(vtkAssembly, )> getJoints() { return m_joints; };
	inline int getJointCount() { return m_joints.size(); };
	inline void setTopoDatas(QVector<TopoData> topos) { m_topos = topos; };
	inline QVector<TopoData> getTopoDatas() { return m_topos; };
	inline TopoData getTopoDatas(int joint_id) { return m_topos.value(joint_id); };
	inline void setRobotId(int id) { m_id = id; };
	inline int getRobotId() { return m_id; };
	inline void setAssembly(SP(vtkAssembly, assembly)) { m_assembly = assembly; };
	inline SP(vtkAssembly, ) getAssembly() { return m_assembly; };
	void getOrigin(int id, double* origin) { 
		origin[0] = m_topos.value(id).origin[0];
		origin[1] = m_topos.value(id).origin[1];
		origin[2] = m_topos.value(id).origin[2];
	};
protected:
	int m_id;
	QString m_path;
	QString m_name;
	QVector<TopoData> m_topos;
	QMap<int, SP(vtkAssembly, )> m_joints;
	SP(vtkAssembly, m_assembly);

};

NAMESPACE_END

#endif // !_ROBOTBASE_H__



